package scala.test_class.test_fanxing

/**
 * @author 黄海峰 2021/4/16 09:49
 * */
class StringIterator(s: String) extends AbsIterator {
  override type T = Char

  private var i = 0

  override def hasNext: Boolean = i < s.length

  override def next(): Char = {
    val ch = s charAt (i)
    i += 1
    ch
  }
}
